using System;
using System.Data;
using System.Configuration;
using System.Collections.Generic;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class forums_controls_forums_forumgrid : Controls.DataManagerForumControl
{
    protected override void ItemChanged()
    {
        List<DAL.Forum> myList = DAL.Forums.GetByParent(CurrentForum);
        gridForums.DataSource = myList; 
        gridForums.DataBind();

        GridHasItems = (myList.Count > 0);
    }

    public bool GridHasItems
    {
        get
        {
            if (ViewState["GridHasItems"] != null)
            {
                return Convert.ToBoolean(ViewState["GridHasItems"]);
            }
            else
            {
                return false;
            }
        }
        set
        {
            ViewState["GridHasItems"] = value;
        }
    }
}
